package com.exer.basic.customhash;

/**
 * hash冥等性
 */
public class App {

    public static void main(String[] args) {
        //Map<String,String> map = new HashMap<>();
        App map = new App();
        map.put("刘一","刘一");
        map.put("陈二","陈二");
        map.put("张三","张三");
        map.put("李四","李四");
        map.put("王五","王五");
        map.put("Money","我是猴哥Money老师");
//        System.out.println(map.get("Money"));
    }

    public void put(String key,String value){
        System.out.printf("key:%s:::::::::::::::;::hash值:%s:::::::::::::::::::存储位置:%s\r\n",key,key.hashCode(),Math.abs(key.hashCode() % 15));
    }
}
//输出结果:
//    key:刘一:::::::::::::::;::hash值:671464:::::::::::::::::::存储位置:4
//    key:陈二:::::::::::::::;::hash值:1212740:::::::::::::::::::存储位置:5
//    key:张三:::::::::::::::;::hash值:774889:::::::::::::::::::存储位置:4
//    key:李四:::::::::::::::;::hash值:842061:::::::::::::::::::存储位置:6
//    key:王五:::::::::::::::;::hash值:937065:::::::::::::::::::存储位置:0
//    key:Monkey:::::::::::::::;::hash值:-1984628749:::::::::::::::::::存储位置:4
